This specification relates to network interface devices.
The physical layer of conventional network protocol stacks include components that serialize and deserialize bit streams, scramble and descramble data, and perform synchronization to align the data to word boundaries.
For example, the IEEE 802.3 Ethernet standard defines a Physical Coding Sublayer (PCS) that lies between the physical layer (PHY) and the media access control (MAC) layer.
On the transmitting side, a user application provides a data packet to be transmitted to the MAC layer. The MAC layer generates an Ethernet frame by adding additional words to surround the data packet to be transmitted, including start and end of packet delimiters as well as a MAC header and a cyclic redundancy check (CRC) field. The Ethernet frame is one type of Ethernet packet.
The PCS sublayer receives, from the MAC layer, the data packet and the additional words generated by the MAC layer. The PCS sublayer checks for valid framing, encodes PCS framing delimiters, adds sync words, and optionally scrambles the data in order to provide the PHY layer with a good ratio of ones to zeros.
The PCS sublayer also adds synchronization words, or for brevity, sync words, to each word of the scrambled data. The corresponding PCS sublayer on the receiving side uses the sync words to ensure that the communication is synchronized. A common synchronization line encoding is a 66/64 encoding in which a sync word of 2 bits is added to every 64-bit word to be transmitted. The sync words “01” and “10” are commonly used. The sync words “11” and “00” are not used. If either is received, the receiving device signals an error.
The PCS sublayer then provides the result to the PHY layer to be transmitted, typically through one or more other sublayers, e.g., through a Physical Medium Attachment (PMA) layer.
Instead of an Ethernet frame, an Ethernet packet can also include a control flow message that the devices can use to coordinate communications.
Either the MAC layer, or the PCS layer, or both also add, between each distinct packet, an interpacket gap. The interpacket gap is a period that the PCS sublayer uses to properly space out delimiters. The bits sent during this period are meaningless, but typically have a substantially even ratio of zeroes and ones due to the scrambling operations of the PCS sublayer. This results in high probability of a substantially 50% ratio of zeros to ones during the interpacket gap. This property allows the PHY layer to maintain DC balance and allows the communicating devices to recover the clock if necessary.
FIG. 1A illustrates the segments of two prior art Ethernet packets. The first packet 101 is an Ethernet frame, which includes a payload 113 of N octets surrounded by a preamble 110, a start-of-frame delimiter 111, and a MAC Header 112 in front of the payload 113; and a cyclic redundancy check value (CRC) 114 after the payload 113. The MAC Header 112 includes up to 18 octets of data, which can include a MAC source address, a MAC destination address, optionally a tag, and a length. The second packet is a control and status message 117.
FIG. 1B illustrates segments processed by a prior art PCS layer. The Ethernet packets 101 and 117 are typically generated by the MAC layer and provided to the PCS layer to be transmitted. When these two Ethernet packets 101 and 117 are received by the PCS layer, the PCS layer checks for proper idle and control words and then encodes the frame by adding various segments that will aid the receiving device in interpreting the received data. The PCS layer will add a PCS idle word 102 and a PCS start-of-packet delimiter 103 before the Ethernet frame 101 and will add a PCS end-of-packet delimiter 104 after the Ethernet frame 101. Similarly, the PCS layer will also encode a control and status message 117 with a proper PCS delimiter to denote the type of message and distinguish it from a data packet. When no packet is needed, the MAC layer sends idle control words, which the PCS layer encodes as idle words that make up the interpacket gaps 116 and 118.
When the Ethernet packets 101 and 117 are transmitted, the PCS sublayer will encode the data, e.g., data words, control messages, or idle words, using an appropriate line encoding, e.g., 66/64 encoding, in which the various segments of the Ethernet packet are broken up at or padded to 64-bit word boundaries and encoded for transmission with 2-bit sync words.